package com.example.goods.model.vo;

import com.example.common.validator.Insert;
import com.example.common.validator.Update;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serializable;

@Data
@EqualsAndHashCode()
@ToString
public class GoodsVO implements Serializable {
    @NotNull(groups = {Update.class}, message = "主键不能为空")
    private Long id;
    @NotNull(groups = {Insert.class},message = "商品分类ID不能为空")
    private Long classifyId;
    @NotNull(groups = {Insert.class},message = "商品名不能为空")
    private String name;
    private String url;
    @NotNull(groups = {Insert.class}, message = "商品价格不能为空")
    @DecimalMin(groups = {Default.class}, value = "0.01", message = "price的最小值为0.01")
    private Double price;
    @NotNull(groups = {Insert.class}, message = "商品VIP价格不能为空")
    @DecimalMin(groups = {Default.class}, value = "0.01", message = "vipPrice最小值为0.01")
    private Double vipPrice;
    private String des;
}
